/*
 * Created on Oct 21, 2003
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package org.vectrics.recruiter.struts.admin;


import org.apache.log4j.Logger;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.vectrics.struts.Request;
import org.vectrics.struts.VectricsActionForm;

public class ConfigurationForm extends VectricsActionForm {

	private static final long serialVersionUID = -602190044758984039L;

	private transient static Logger log = Logger.getLogger(AdminJobForm.class);
	private String domainId = null;
	private String resumeEmailAddress = null;
	private String resumeEmailHost = null;
	private String resumeEmailPassword = null;
	
	
	
	/**
	 * @return Returns the domainId.
	 */
	public String getDomainId() {
		return domainId;
	}

	/**
	 * @param domainId The domainId to set.
	 */
	public void setDomainId(String domainId) {
		this.domainId = domainId;
	}

	/**
	 * @return Returns the resumeEmailAddress.
	 */
	public String getResumeEmailAddress() {
		return resumeEmailAddress;
	}
	
	/**
	 * @param resumeEmailAddress The resumeEmailAddress to set.
	 */
	public void setResumeEmailAddress(String resumeEmailAddress) {
		this.resumeEmailAddress = resumeEmailAddress;
	}
	
	/**
	 * @return Returns the resumeEmailHost.
	 */
	public String getResumeEmailHost() {
		return resumeEmailHost;
	}
	
	/**
	 * @param resumeEmailHost The resumeEmailHost to set.
	 */
	public void setResumeEmailHost(String resumeEmailHost) {
		this.resumeEmailHost = resumeEmailHost;
	}
	
	/**
	 * @return Returns the resumeEmailPassword.
	 */
	public String getResumeEmailPassword() {
		return resumeEmailPassword;
	}
	
	/**
	 * @param resumeEmailPassword The resumeEmailPassword to set.
	 */
	public void setResumeEmailPassword(String resumeEmailPassword) {
		this.resumeEmailPassword = resumeEmailPassword;
	}
	
	public ActionErrors validate(ActionMapping mapping, Request request) {
		log.debug("validate() called");
	ActionErrors errors = new ActionErrors();
	/*
	if (this.wasButtonPressed(request, "cancel") == false) {
		if ((getTitle() == null) || (getTitle().trim().length() <= 0)) {
			errors.add("Title", new ActionError("error.job.title.required"));			
		}
		
		BigDecimal salary = null;
		BigDecimal salaryMax = null;
		if (!isBlank(this.getSalary())) {
			try {
				salary = this.stringToMoney(this.getSalary());
			} catch (Exception ex) {
				errors.add("salary", new ActionError("error.job.salary.format.invalid"));			
			}
		}
		
		if (isBlank(this.getHiringManager())) {
			errors.add("hiringManager", new ActionError("error.job.hiring.manager.not.selected"));			
		}
		
		if (!isBlank(this.getSalaryMax())) {
			try {
				salaryMax = this.stringToMoney(this.getSalaryMax());
			} catch (Exception ex) {
				errors.add("salaryMax", new ActionError("error.job.salary.format.invalid"));			
			}
		}
		
		// If min and max salary given, make sure min is less than max
		if ((salary != null) && (salaryMax != null)) {
			if (salary.compareTo(salaryMax) > 0) {
				errors.add("salaryMax", new ActionError("error.job.salary.max.less.than.min"));			
			}
		}
	} else {
		log.debug("Cancel button was pressed, no validation performed");
	}
	
	if (errors.isEmpty()) {
		log.debug("validate() - no errors");
	}		
	else {
		log.debug("validate() - errors found");
	}
	
	attachFormObjectsToRequest(request);
	*/
		String mappingAttr = mapping.getAttribute();
		request.setAttribute(mappingAttr, this);
		return(errors);	
	}
	
}